local ads__wensheng = fk.CreateSkill {
  name = "ads__wensheng",
}

ads__wensheng:addEffect("viewas", {
  pattern = ".|.|red",
  prompt = "#ads__wensheng",
  anim_type = "offensive",
  handly_pile = true,
  interaction = function(self, player)
    local all_names = Fk:getAllCardNames("bt")
    local names = player:getViewAsCardNames(ads__wensheng.name, all_names)
    if #names > 0 then
      return UI.ComboBox {choices = names, all_choices = all_names}
    end
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).trueName ~= "slash"
  end,
  view_as = function(self, player, cards)
    if #cards ~= 1 or not self.interaction.data then return end
    local card = Fk:cloneCard(self.interaction.data)
    card:addSubcards(cards)
    card.skillName = ads__wensheng.name
    return card
  end,
  enabled_at_play = function(self, player)
    return true
  end,
  enabled_at_response = function(self, player, response)
    return true
  end,
})

Fk:loadTranslationTable{
  ["$ads__wensheng1"] = "关羽在此，尔等受死！",
  ["$ads__wensheng2"] = "看尔乃插标卖首！",
  ["ads__wensheng"] = "文圣",
  [":ads__wensheng"] = "你可以将一张非【杀】牌当任意红色基本牌或锦囊牌使用或打出。",
  ["#ads__wensheng"] = "发动 文圣，将一张非【杀】牌当红色牌使用或打出",
}


ads__wensheng:addAI(nil, "vs_skill")

return ads__wensheng
